<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateShopBannerTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('shop_banner', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name', 20)->comment('名称');
            $table->string('url', 255)->comment('图片url');
            $table->integer('is_global',4)->comment('是否全国使用');
            $table->integer('city_id')->comment('城市id');
            $table->string('type', 255)->comment('跳转类型');
            $table->integer('location_type',4)->comment('位置类型（1:首页顶部、2:首页本地生活）');
            $table->string('content', 255)->comment('内容');
            $table->integer('sort')->default(0)->comment('排序');
            $table->date('start_time')->comment('开始时间');
            $table->date('last_time')->comment('结束时间');
            $table->integer('is_login',4)->default(0)->comment('是否需要登录');
            $table->integer('status',4)->default(0)->comment('1:上架0:下架');
            $table->integer('admin_id')->default(0)->comment('操作人id');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('shops_banners');
    }
}
